#{extends 'main.html' /}
<div>
    <ul>
        <li><a href="">个人资料</a></li>
        <li><a href="">修改密码</a></li>
        <li><a href="">修改头像</a></li>
        <li><a href="">账户充值</a></li>
        <li><a href="">收支记录</a></li>
        <li><a href="">申请发票</a></li>
        <li><a href="">我的背包</a></li>
    </ul>
</div>
<div>
    <div class="box">
        <div class="form-horizontal">

            <div class="form-group">
                <label class="control-label col-md-2" >短信息</label>
                <div class="col-md-10">
                    <input class="form-control text-box single-line" name="note" />
                    <span class="field-validation-valid text-danger" data-valmsg-for="moneys" data-valmsg-replace="true"></span>
                </div>

            </div>
            </div>
        <div class="form-horizontal">

            <div class="form-group">
                <label class="control-label col-md-2" >短信息</label>
                <div class="col-md-10">
                    <input class="form-control text-box single-line" id="codes" name="note" />
                    <a href="javascript:void(0);" onclick="verification_Code()">发送邮箱</a>
                </div>

            </div>
        </div>
        <div class="form-horizontal">

            <div class="form-group">
                <label class="control-label col-md-2" >短信息</label>
                <div class="col-md-10">
                    <input class="form-control text-box single-line" name="note" />
                    <a href="">发送手机</a>
                </div>

            </div>
        </div>
    </div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>

<script src="http://cdn.bootcss.com/blueimp-md5/1.1.0/js/md5.js"></script>

<script src="http://cdn.bootcss.com/blueimp-md5/1.1.0/js/md5.min.js"></script>
<script>
    Date.prototype.Format = function(fmt)
    { //author: meizz
        var o = {
            "M+" : this.getMonth()+1,                 //月份
            "d+" : this.getDate(),                    //日
            "h+" : this.getHours(),                   //小时
            "m+" : this.getMinutes(),                 //分
            "s+" : this.getSeconds(),                 //秒
            "q+" : Math.floor((this.getMonth()+3)/3), //季度
            "S"  : this.getMilliseconds()             //毫秒
        };
        if(/(y+)/.test(fmt))
            fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
        for(var k in o)
            if(new RegExp("("+ k +")").test(fmt))
                fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
        return fmt;
    }
    function verification_Code(){
        var codes= document.getElementById("codes");
        var id = new Date().Format("hhmmssS");
        ids = id;
        id = md5(id);
        $.ajax({
            type: "POST",
            data:{"md5":id,"md51":ids,"Email":codes.value},
            url: "/verification/Code",
            dataType: "json",
            success: function(data){
                var code = data.code;
               if(code== -1){
                   alert("发送失败！");
               } else if (code == 0){
                   alert("非法操作");
               }else if(code == 1){
                   alert("发送成功！");
               }else if(code == -2){
                   alert("非法操作！");
               }
            }

        });
    }

</script>
